
import request from "@/utils/request";
import type { AxiosPromise } from "axios";


interface Phone {
    tel: number
}

interface TelCode {
    telcode: string
}

interface Pwd {
    password: string
}

interface TelAndCode extends Phone, TelCode { }
interface RegMsg extends Phone, Pwd { }

export interface LoginParams extends Pwd {
    loginname: string,
}


export const doCheckPhoneAPI = (params: Phone): AxiosPromise => request.post("/user/docheckphone", params);
export const doSendMsgCodeAPI = (params: Phone): AxiosPromise => request.post("/user/dosendmsgcode", params);
export const doCheckCodeAPI = (params: TelAndCode): AxiosPromise => request.post("/user/docheckcode", params);
export const doFinishRegisterAPI = (params: RegMsg): AxiosPromise => request.post("/user/dofinishregister", params);
export const doUserLoginAPI = (params: LoginParams): AxiosPromise => request.post("/user/login", params);